package com.dbb.util;

import java.util.Locale;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.support.ResourceBundleMessageSource;

import com.opensymphony.xwork2.ActionContext;

/**
 * 资源工具
 */
public class ResourceUtil {
	private ResourceBundleMessageSource messageSource;
	public ResourceUtil(ResourceBundleMessageSource messageSource) {
		this.messageSource = messageSource;
	}
	public String getProperties(String key) {
		return messageSource.getMessage(key, null, Locale.getDefault());
	}
	
	public static String FROM = ServletActionContext.getServletContext().getRealPath("/") + "/";
	public static String TO = ServletActionContext.getServletContext().getRealPath("/") + "/";
	
	public static String getRealPath() {
		return "C:/workspace/ghtrade/target/src/main/resources/";
//		return ServletActionContext.getServletContext().getRealPath("/");
	}

}